package com.wushi.lenovo.asia5b.app_ui.other.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.github.chrisbanes.photoview.PhotoView;
import com.mvp.base.BaseAppCompatActivity;
import com.wushi.lenovo.asia5b.R;
import com.wushi.lenovo.asia5b.app_config.CommonConstant;

import butterknife.BindView;

/**
 * Created by zhangyuncai on 2019/5/25.
 * 查看图片文档
 */
public class PdfPreviewImageActivity extends BaseAppCompatActivity {
    @BindView(R.id.tv_title_left_back)
    TextView tv_title_left_back;
    @BindView(R.id.tv_title_titletext)
    TextView tv_title_titletext;
    @BindView(R.id.iv_pdf_img)
    PhotoView iv_pdf_img;

    public static void startPdfPreview2Activity(Context context, String imgFilePath, String orderNo) {
        Intent intent = new Intent(context, PdfPreviewImageActivity.class);
        intent.putExtra(CommonConstant.PREVIEW_PDF_ORDERNO, orderNo);
        intent.putExtra(CommonConstant.PREVIEW_IMG_FILEPATH, imgFilePath);
        context.startActivity(intent);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_pdfpreviewimage;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
        initData();
        initEvent();
    }

    @Override
    protected void initView() {
        String imgPath = getIntent().getStringExtra(CommonConstant.PREVIEW_IMG_FILEPATH);
        String orderNo = getIntent().getStringExtra(CommonConstant.PREVIEW_PDF_ORDERNO);
        Glide.with(this)
                .load(imgPath)
                .into(iv_pdf_img);
        if (!TextUtils.isEmpty(orderNo)) {
            tv_title_titletext.setText(orderNo);
        }

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvent() {

    }
}
